import { Button } from 'vant'
import { cart } from '@/components/vant/cart.ts'
import { category } from '@/components/vant/category.ts'
import { detail } from '@/components/vant/detail.ts'
import { home } from '@/components/vant/home.ts'
import { my } from '@/components/vant/my.ts'
import { order } from '@/components/vant/order.ts'
import { search } from '@/components/vant/search.ts'
import { zhide } from '@/components/vant/zhide.ts'
import { Tabbar, TabbarItem } from 'vant'
import type { App } from 'vue'

// 将需要批量注册的组件放到一个数组中
const components = new Set([
  Button,
  Tabbar,
  TabbarItem,
  ...cart,
  ...category,
  ...detail,
  ...home,
  ...my,
  ...order,
  ...search,
  ...zhide
])

export default {
  install(app: App) {
    components.forEach((component) => {
      app.component(component.name, component)
    })
  }
}
